/**
 * 
 */
package com.jjt.kiki.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @author jiangjintai
 *
 */
public class SpringUtil implements ApplicationContextAware {
	private static ApplicationContext appContext;
	/* （非 Javadoc）
	 * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
	 */
	@Override
	public void setApplicationContext(ApplicationContext arg0)
			throws BeansException {
		// 
		SpringUtil.appContext=arg0;
	}
	
    public static Object getBean(String name){  
        return appContext.getBean(name);  
    } 
}
